package com.kylin.upms.biz.web;


import com.kylin.upms.biz.service.IMenuRoleService;
import com.kylin.upms.biz.vo.ResEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mht
 * @since 2019-09-15
 */
@RestController
@RequestMapping("/menuRole")
public class MenuRoleController {
    @Autowired
    IMenuRoleService iMenuRoleService;
    @RequestMapping(method = RequestMethod.GET,value = "/updMenuByRole")
    public ResEntity updMenuByRole(Integer rid, Integer[] mid){
        iMenuRoleService.deleteById(rid);
        for (Integer i : mid) {
            Integer integer = iMenuRoleService.addMenuRole(rid, i);
        }
        return ResEntity.ok("插入成功");
    }
}
